package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 销售配套
 * </p>
 *
 * @author yinjc123
 * @since 2018-04-03
 */
@TableName("crm_sale")
@Data
public class Sale extends Model<Sale> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 企业id
     */
    @TableField("customer_company_id")
    @NotNull(message = "企业id不能为空")
    private Integer customerCompanyId;
    /**
     * 年度
     */
    @NotNull(message = "年度不能为空")
    private Integer year;

    /**
     * 客户名称
     */
    @TableField("customer_name")
    private String customerName;

    /**
     * 供应产品
     */
    @NotBlank(message = "供应产品不能为空")
    private String product;
    /**
     * 年供应量金额
     */
    @TableField("annual_supply")
    @NotNull(message = "年供应量金额不能为空")
    private BigDecimal annualSupply;
    /**
     * 应收账款余额
     */
    @TableField("account_receivable_balance")
    private BigDecimal accountReceivableBalance;
    /**
     * 挂账余额
     */
    @TableField(" credit_balance")
    private BigDecimal  creditBalance;
    /**
     * 现金收款量
     */
    @TableField("cash_receipted")
    private BigDecimal cashReceipted;
    /**
     * 银票收款量
     */
    @TableField("silver_ticket_recivied")
    private BigDecimal silverTicketRecivied;
    /**
     * 商票收款量
     */
    @TableField("business_ticket_recivied")
    private BigDecimal businessTicketRecivied;
    /**
     *  一般期限 
     */
    private Integer period;
    /**
     * 商票贴现量
     */
    @TableField("business_ticket_discount")
    private BigDecimal businessTicketDiscount;
    /**
     * 贴现利率
     */
    @TableField("discount_Interest_rate")
    private Float discountInterestRate;

    /**
     * 逻辑删除
     */
    @TableField(value = "delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
